--
--
--Applicant
--
--
--Add Applicant
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Applicant_add]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Applicant_add]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Applicant_add]
	@FirstName as nvarchar(256),
	@LastName as nvarchar(256),
	@Gender as bit,
	@DOB as datetime,
	@PhoneNumber as nvarchar(16),
	@Email as nvarchar(256), 
	@Address as nvarchar(1000), 
	@Status as int, 
	@SalaryRequirement as float, 
	@Language as nvarchar(256), 
	@YearOfExperience as int, 
	@Degree as nvarchar(256), 
	@CreatedDate as datetime, 
	@Skill as nvarchar(max), 
	@Award as nvarchar(max)
as
insert into dbo.[Applicant](
	FirstName,
	LastName,
	Gender,
	DOB,
	PhoneNumber,
	Email, 
	Address, 
	Status, 
	SalaryRequirement, 
	[Language], 
	YearOfExperience, 
	Degree, 
	CreatedDate, 
	Skill, 
	Award)
values(
	@FirstName,
	@LastName,
	@Gender,
	@DOB,
	@PhoneNumber,
	@Email, 
	@Address, 
	@Status, 
	@SalaryRequirement, 
	@Language, 
	@YearOfExperience, 
	@Degree, 
	@CreatedDate, 
	@Skill, 
	@Award)

select SCOPE_IDENTITY()

GO

--Update Applicant
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Applicant_update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Applicant_update]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Applicant_update]
	@ApplicantID as int,
	@FirstName as nvarchar(256),
	@LastName as nvarchar(256),
	@Gender as bit,
	@DOB as datetime,
	@PhoneNumber as nvarchar(16),
	@Email as nvarchar(256), 
	@Address as nvarchar(1000), 
	@Status as int, 
	@SalaryRequirement as float, 
	@Language as nvarchar(256), 
	@YearOfExperience as int, 
	@Degree as nvarchar(256), 
	@CreatedDate as datetime, 
	@Skill as nvarchar(max), 
	@Award as nvarchar(max)
as
update dbo.[Applicant] set
	FirstName= @FirstName,
	LastName= @LastName,
	Gender= @Gender,
	DOB= @DOB,
	PhoneNumber= @PhoneNumber,
	Email= @Email, 
	Address= @Address, 
	Status= @Status, 
	SalaryRequirement= @SalaryRequirement, 
	[Language]= @Language, 
	YearOfExperience= @YearOfExperience, 
	Degree= @Degree, 
	CreatedDate= @CreatedDate, 
	Skill= @Skill, 
	Award= @Award
where(@ApplicantID= dbo.[Applicant].ApplicantID)

GO

--Delete Applicant
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Applicant_delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Applicant_delete]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Applicant_delete]
	@ApplicantID as int
as
delete dbo.[Applicant]
where(@ApplicantID= dbo.[Applicant].ApplicantID)

GO

--Select id Applicant
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Applicant_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Applicant_get]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Applicant_get]
	@ApplicantID as int
as
select ApplicantID, FirstName, LastName, Gender, DOB, PhoneNumber, Email, Address, Status, SalaryRequirement, Language, YearOfExperience, Degree, CreatedDate, Skill, Award
from dbo.[Applicant]
where(@ApplicantID= dbo.[Applicant].ApplicantID)

GO

--Select all Applicant
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Applicant_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Applicant_getall]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Applicant_getall]
as
select ApplicantID, FirstName, LastName, Gender, DOB, PhoneNumber, Email, Address, Status, SalaryRequirement, Language, YearOfExperience, Degree, CreatedDate, Skill, Award
from dbo.[Applicant]

GO

--
--
--Department
--
--

--Add Department
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Department_add]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Department_add]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Department_add]
	@Name as nvarchar(256),
	@Email as nvarchar(256),
	@PhoneNumber as nvarchar(16),
	@LeaderName as nvarchar(256), 
	@Description as nvarchar(max)
as
insert into dbo.[Department](
	[Name],
	Email,
	PhoneNumber,
	LeaderName, 
	Description)
values(
	@Name,
	@Email,
	@PhoneNumber,
	@LeaderName, 
	@Description)

select SCOPE_IDENTITY()

GO

--Update Department
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Department_update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Department_update]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Department_update]
	@DepartmentID int,
	@Name as nvarchar(256),
	@Email as nvarchar(256),
	@PhoneNumber as nvarchar(16),
	@LeaderName as nvarchar(256), 
	@Description as nvarchar(max)
as
update dbo.[Department] set
	[Name]= @Name,
	Email= @Email,
	PhoneNumber= @PhoneNumber,
	LeaderName= @LeaderName, 
	Description= @Description
where(@DepartmentID= dbo.[Department].DepartmentID)

GO

--Delete Department
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Department_delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Department_delete]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Department_delete]
	@DepartmentID int
as
delete dbo.[Department]
where(@DepartmentID= dbo.[Department].DepartmentID)

GO

--Select id Department
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Department_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Department_get]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Department_get]
	@DepartmentID int
as
select DepartmentID, Name, Email, PhoneNumber, LeaderName, Description
from dbo.[Department]
where(@DepartmentID= dbo.[Department].DepartmentID)

GO

--Select all Department
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Department_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Department_getall]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Department_getall] 
as
select DepartmentID, [Name], Email, PhoneNumber, LeaderName, Description
from dbo.[Department]

GO

--
--
--Employee
--
--

--Add Employee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Employee_add]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Employee_add]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Employee_add]
	@DepartmentID as int,
	@FirstName as nvarchar(256),
	@LastName as nvarchar(256),
	@Gender as bit,
	@DOB as datetime,
	@PhoneNumber as nvarchar(256),
	@Email as nvarchar(256),
	@Address as nvarchar(1000),
	@Position as nvarchar(256),
	@Account as nvarchar(128),
	@Password as nvarchar(128)
as
insert into dbo.[Employee](
	DepartmentID,
	FirstName,
	LastName,
	Gender,
	DOB,
	PhoneNumber,
	Email,
	Address,
	Position,
	Account,
	Password)
values(
	@DepartmentID,
	@FirstName,
	@LastName,
	@Gender,
	@DOB,
	@PhoneNumber,
	@Email,
	@Address,
	@Position,
	@Account,
	@Password)

select SCOPE_IDENTITY()

GO

--Update Employee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Employee_update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Employee_update]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Employee_update]
	@EmployeeID as int,
	@DepartmentID as int,
	@FirstName as nvarchar(256),
	@LastName as nvarchar(256),
	@Gender as bit,
	@DOB as datetime,
	@PhoneNumber as nvarchar(256),
	@Email as nvarchar(256),
	@Address as nvarchar(1000),
	@Position as nvarchar(256),
	@Account as nvarchar(128),
	@Password as nvarchar(128)
as
update dbo.[Employee] set
	DepartmentID= @DepartmentID,
	FirstName= @FirstName,
	LastName= @LastName,
	Gender= @Gender,
	DOB= @DOB,
	PhoneNumber= @PhoneNumber,
	Email= @Email,
	Address= @Address,
	Position= @Position,
	Account= @Account,
	Password= @Password
where(@EmployeeID= dbo.[Employee].EmployeeID)

GO

--delete Employee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Employee_delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Employee_delete]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Employee_delete]
	@EmployeeID as int
as
delete dbo.[Employee]
where(@EmployeeID= dbo.[Employee].EmployeeID)

GO

--select id Employee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Employee_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Employee_get]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Employee_get]
	@EmployeeID as int
as
select EmployeeID, DepartmentID, FirstName, LastName, Gender, DOB, PhoneNumber, Email, Address, Position, Account, Password
from dbo.[Employee]
where(@EmployeeID= dbo.[Employee].EmployeeID)

GO

--select all Employee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Employee_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Employee_getall]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Employee_getall]
as
select EmployeeID, DepartmentID, FirstName, LastName, Gender, DOB, PhoneNumber, Email, Address, Position, Account, Password
from dbo.[Employee]

GO


--AD

--Vacancy


if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Vacancy_add]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Vacancy_add]
GO
--Created:09/03/2012
--Insert:
--beginInsert:
CREATE procedure dbo.[Vacancy_add]
@DepartmentID as int,
@Title as nvarchar(256),
@CreatedDate as datetime,
@Status as int,
@NumberRequirement as int,
@Position as nvarchar(256),
@WorkingPlace as nvarchar(256),
@WorkType as nvarchar(250),
@MinimumSalary as float,
@MaximumSalary as float,
@Description as nvarchar(max),
@SkillRequirement as nvarchar(max),
@Entitlement as nvarchar(max),
@MinimumAge as int,
@MaximumAge as int,
@Gender as bit,
@Degree as nvarchar(256),
@YearOfExperience as int,
@ProbationaryPeriod as nvarchar(256),
@Deadline as datetime

 as 
insert into dbo.[CatagoryNews](
DepartmentID, Title, CreatedDate, Status, NumberRequirement, Position, WorkingPlace, WorkType, MinimumSalary, MaximumSalary, Description, SkillRequirement, Entitlement, MinimumAge, MaximumAge, Gender, Degree, YearOfExperience, ProbationaryPeriod, Deadline
)
values(
@DepartmentID, @Title, @CreatedDate, @Status, @NumberRequirement, @Position, @WorkingPlace, @WorkType, @MinimumSalary, @MaximumSalary, @Description, @SkillRequirement, @Entitlement, @MinimumAge, @MaximumAge, @Gender, @Degree, @YearOfExperience, @ProbationaryPeriod, @Deadline)
select SCOPE_IDENTITY()
--endInsert
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Vacancy_update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Vacancy_update]
GO
--Created:09/03/2012
--beginUpdate:
Create procedure dbo.[Vacancy_update]
@VacancyID as int,
@DepartmentID as int,
@Title as nvarchar(256),
@CreatedDate as datetime,
@Status as int,
@NumberRequirement as int,
@Position as nvarchar(256),
@WorkingPlace as nvarchar(256),
@WorkType as nvarchar(250),
@MinimumSalary as float,
@MaximumSalary as float,
@Description as nvarchar(max),
@SkillRequirement as nvarchar(max),
@Entitlement as nvarchar(max),
@MinimumAge as int,
@MaximumAge as int,
@Gender as bit,
@Degree as nvarchar(256),
@YearOfExperience as int,
@ProbationaryPeriod as nvarchar(256),
@Deadline as datetime
 as 
update dbo.[Vacancy] set 
@DepartmentID=@DepartmentID , 
@Title = @Title,
@CreatedDate=@CreatedDate, 
@Status=@Status, 
@NumberRequirement=@NumberRequirement,
@Position=@Position, 
@WorkingPlace=@WorkingPlace, 
@WorkType=@WorkType, 
@MinimumSalary=@MinimumSalary, 
@MaximumSalary=@MaximumSalary, 
@Description=@Description, 
@SkillRequirement=@SkillRequirement, 
@Entitlement=@Entitlement, 
@MinimumAge=@MinimumAge ,
@MaximumAge=@MaximumAge, 
@Gender=@Gender, 
@Degree=@Degree, 
@YearOfExperience =@YearOfExperience,
@ProbationaryPeriod=@ProbationaryPeriod, 
@Deadline=@Deadline
 where 	(@VacancyID=dbo.[Vacancy].VacancyID)
--endUpdate:
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Vacancy_delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Vacancy_delete]
GO
--Created:09/03/2012
--BeginDelete
CREATE procedure dbo.[Vacancy_delete]
@VacancyID as int
 as 
delete dbo.[Vacancy]
 where 	(@VacancyID=dbo.[Vacancy].VacancyID)
--endDelete
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Vacancy_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Vacancy_get]
GO

--Created:09/03/2012
--BeginSelectByVacancyIDId
Create procedure dbo.[Vacancy_get]
@VacancyID as int
 as 
select 	* from dbo.[Vacancy]
 where 	(@VacancyID=dbo.[Vacancy].VacancyID)
--EndSelectByVacancyIDId
GO


if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Vacancy_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Vacancy_getall]
GO
--Created:09/03/2012
--BeginSelectAllVacancy
Create procedure dbo.[Vacancy_getall]
 as 
select 	* from  dbo.[Vacancy]
--EndSelectAllVacancy
GO

--
--
--SchedulingInterview
--

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[SchedulingInterview_add]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[SchedulingInterview_add]
GO
--Created:09/03/2012
--BigenInsert
CREATE procedure dbo.[SchedulingInterview_add]
@EmployeeID as int,
@ApplicantID as int,
@Status int,
 @Time datetime
 as 
insert into dbo.[SchedulingInterview]( EmployeeID,ApplicantID, Status, [Time])
values( @EmployeeID,@ApplicantID, @Status, @Time)
select SCOPE_IDENTITY()
--EndInsert
execute SchedulingInterview_add 1,2,3,null
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[SchedulingInterview_update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[SchedulingInterview_update]
GO
--Created:09/03/2012
--BeginUpdate
CREATE procedure dbo.[SchedulingInterview_update]
@EmployeeID as int,
@ApplicantID as int,
@Status int,
@Time datetime
 as 
update dbo.[SchedulingInterview] set 
@ApplicantID=@ApplicantID,
@Status=@Status,
@Time=@Time
 where 	(@EmployeeID=dbo.[SchedulingInterview].EmployeeID)
--EndUpdate
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[SchedulingInterview_delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[SchedulingInterview_delete]
GO
--Created:09/03/2012
--BeginDelete
CREATE procedure dbo.[SchedulingInterview_delete]
@EmployeeID as int
 as 
delete dbo.[SchedulingInterview]
 where (@EmployeeID=dbo.[SchedulingInterview].EmployeeID)
--EndDelete
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[SchedulingInterview_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[SchedulingInterview_get]
GO
--Created:09/03/2012
--BeginSelectBy@EmployeeID 
CREATE procedure dbo.[SchedulingInterview_get]
@EmployeeID as int
 as 
select * from  dbo.[SchedulingInterview]
 where 	(@EmployeeID=dbo.[SchedulingInterview].EmployeeID)
--EndSelectBy@EmployeeID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[SchedulingInterview_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[SchedulingInterview_getall]
GO
--Created:09/03/2012
--BeginSelectAllSchedulingInterview
CREATE procedure dbo.[SchedulingInterview_getall]
 as 
select 	* from  dbo.[SchedulingInterview]
--EndSelectAllSchedulingInterview
GO

--
--
--Role
--
--
--Select id Role
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Role_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Role_get]
GO
--Created:09/03/2012
CREATE procedure dbo.[Role_get]
@RoleName as nvarchar(256)
 as 
select * from  dbo.[Role]
 where 	(@RoleName=dbo.[Role].RoleName)
GO


--Select all Role
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Role_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Role_getall]
GO
--Created:09/03/2012
CREATE procedure dbo.[Role_getall]
 as 
select * from  dbo.[Role]
GO
execute Role_getall

--
--
--RoleOfEmployee
--
--
--Select id RoleOfEmployee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[RoleOfEmployee_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[RoleOfEmployee_get]
GO
--Created:09/03/2012
CREATE procedure dbo.[RoleOfEmployee_get]
@EmployeeID as int
 as 
select * from  dbo.[RoleOfEmployee]
 where 	(@EmployeeID=dbo.[RoleOfEmployee].EmployeeID)
GO


--Select all RoleOfEmployee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[RoleOfEmployee_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[RoleOfEmployee_getall]
GO
--Created:09/03/2012
CREATE procedure dbo.[RoleOfEmployee_getall]
 as 
select * from  dbo.[RoleOfEmployee]
GO
execute RoleOfEmployee_getall


---VacancyOfApplicant

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[VacancyOfApplicant_add]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[VacancyOfApplicant_add]
GO
--Created:09/03/2012
--BigenInsert
CREATE procedure dbo.[VacancyOfApplicant_add]
@VacancyID as int,
@ApplicantID as int
as
insert into dbo.[VacancyOfApplicant]( VacancyID,ApplicantID)
values( @VacancyID,@ApplicantID)
select SCOPE_IDENTITY()
--EndInsert
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[VacancyOfApplicant_update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[VacancyOfApplicant_update]
GO
--Created:09/03/2012
--BeginUpdate
CREATE procedure dbo.[VacancyOfApplicant_update]
@VacancyID as int,
@ApplicantID as int
 as 
update dbo.[VacancyOfApplicant] set 
@VacancyID=@VacancyID,
@ApplicantID=@ApplicantID
 where 	(@VacancyID=dbo.[VacancyOfApplicant].VacancyID)
--EndUpdate
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[VacancyOfApplicant_delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[VacancyOfApplicant_delete]
GO
--Created:09/03/2012
--BeginDelete
CREATE procedure dbo.[VacancyOfApplicant_delete]
@VacancyID as int
 as 
delete dbo.[VacancyOfApplicant]
 where (@VacancyID=dbo.[VacancyOfApplicant].VacancyID)
--EndDelete
GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[VacancyOfApplicant_get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[VacancyOfApplicant_get]
GO
--Created:09/03/2012
--BeginSelectBy@EmployeeID 
CREATE procedure dbo.[VacancyOfApplicant_get]
@VacancyID as int
 as 
select * from  dbo.[VacancyOfApplicant]
 where 	(@VacancyID=dbo.[VacancyOfApplicant].VacancyID)
--EndSelectBy@EmployeeID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[VacancyOfApplicant_getall]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[VacancyOfApplicant_getall]
GO
--Created:09/03/2012
--BeginSelectAllSchedulingInterview
CREATE procedure dbo.[VacancyOfApplicant_getall]
 as 
select 	* from  dbo.[VacancyOfApplicant]
--EndSelectAllSchedulingInterview
GO




--Validate Account-Employee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Employee_ValiAc]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Employee_ValiAc]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Employee_ValiAc]
	@Account as nvarchar(128)
as
select * from dbo.[Employee]
where(@Account= dbo.[Employee].Account)

GO

--Validate Email-Employee
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.[Employee_ValiEmail]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.[Employee_ValiEmail]
GO
--Created:11/10/2012
--Author:
CREATE procedure dbo.[Employee_ValiEmail]
	@Email as nvarchar(256)
as
select * from dbo.[Employee]
where(@Email= dbo.[Employee].Email)

GO